<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>destructuring</title>
</head>
<body>
<script>
    // 2、从函数返回多个值
        function fun() {
            /*return {
                a:1,
                b:2
            }*/
            return [1,2,3];
        }

    console.log(fun());
        var [x,y,z]=fun();
        console.log(x)
        console.log(y)
        console.log(z)

    function fun2() {
        return {
            a:1,
            b:2
        }
    }

    var {a:a1,b:b1}=fun2();
    console.log(a1)
    console.log(b1)
</script>
</body>
</html>